Improve the Request Handle Errors

32

import requests
 
url = 'wrong url'
 
try:
    r = requests.get(url)
except Exception as e:
    print(f'There was an error: {e}')

Comments

Submit
0 Comments